<?php
/**
 * 微信基类
 * User: Administrator
 * Date: 2020/7/5
 * Time: 14:28
 */

namespace app\wechat\controller;

use app\common\controller\Frontend;
use EasyWeChat\Factory;
use think\Config;
use think\Request;
use EasyWeChat\Foundation\Application;

class BaseWx extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';

    public $app;

    public function __construct(Request $request = null)
    {
        parent::__construct($request);

        $config = Config::get('wechat');
        $this->app = Factory::officialAccount($config);

        //小程序
        //$config = Config::get('mini_program');
        //$this->app = Factory::miniProgram($config);
    }

}